package com.jrx.anytxn.transaction.service;

import com.jrx.anytxn.common.exception.TxnBizException;
import com.jrx.anytxn.common.exception.TxnException;
import com.jrx.anytxn.transaction.bean.CalPayOffFeeBean;
import com.jrx.anytxn.transaction.bean.CastAccountTransactionBean;
import com.jrx.anytxn.transaction.bean.DelqParamBean;
import com.jrx.anytxn.transaction.bean.PaymentSaveBean;
import com.jrx.anytxn.transaction.entity.AmLoanAccountInfo;
import com.jrx.anytxn.transaction.entity.AmLoanMainInfo;
import com.jrx.anytxn.transaction.entity.AmRepaymentPlanInfo;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @program: anytxn-cf-transaction
 * @description: 费用相关处理操作接口
 * @author: xiaoyu.jing
 * @date: 2019-10-16 13:21
 **/
public interface IFeeService {

    /**
     * 计算提前结清手续费,获取提前结清费用交易账户,分期费用交易账户，利息交易账户
     * @param saveBean
     * @param loanMainInfo
     * @param loanAccountInfo
     * @param delqParamBean
     * @param bussinessDate
     * @throws TxnBizException
     */
    void castPayOffFeeAndIntrAcct(PaymentSaveBean saveBean, AmLoanMainInfo loanMainInfo, AmLoanAccountInfo loanAccountInfo, DelqParamBean delqParamBean,
                                  Date bussinessDate) throws TxnException;

    /**
     * 计算提前还款手续费,获取费用交易账户
     * @param loanMainInfo
     * @param loanAccountInfo
     * @param bussinessDate
     * @param liabilityFlag
     * @return
     * @throws TxnException
     */
    CastAccountTransactionBean getPrePayFeeAcct(AmLoanMainInfo loanMainInfo, AmLoanAccountInfo loanAccountInfo,Date bussinessDate,String liabilityFlag) throws TxnException;

    /**
     * 计算提前结清产生的手续费，分期费用以及利息
     *
     * @param loanMainInfo
     * @param planInfoList
     * @return
     * @throws TxnBizException
     */
    CalPayOffFeeBean getPayOffFeeAcct(AmLoanMainInfo loanMainInfo, AmLoanAccountInfo loanAccountInfo,
                                      List<AmRepaymentPlanInfo> planInfoList) throws TxnBizException;

    /**
     * 获取提前还款手续费
     * @param loanMainInfo
     * @param loanAccountInfo
     * @return
     * @throws TxnException
     */
    BigDecimal getPrePayFee(AmLoanMainInfo loanMainInfo,AmLoanAccountInfo loanAccountInfo) throws TxnException;
}
